<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <!-- 设置页面的 基本路径，页面所有资源引入和页面的跳转全部基于 base路径 -->
    <base th:href="${#request.getContextPath()}+'/'">
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,prescriptionSurcharge-scalable=no"/>
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <link rel="Bookmark" href="/favicon.ico">
    <link rel="Shortcut Icon" href="/favicon.ico"/>

    <script type="text/javascript" th:src="@{/lib/html5shiv.js}"></script>
    <script type="text/javascript" th:src="@{/lib/respond.min.js}"></script>


    <link rel="stylesheet" type="text/css" th:href="@{/h-ui/css/H-ui.min.css}"/>
    <link rel="stylesheet" type="text/css" th:href="@{/h-ui.admin/css/H-ui.admin.css}"/>
    <link rel="stylesheet" type="text/css" th:href="@{/lib/Hui-iconfont/1.0.8/iconfont.css}"/>
    <link rel="stylesheet" type="text/css" th:href="@{/h-ui.admin/skin/default/skin.css}" id="skin"/>
    <link rel="stylesheet" type="text/css" th:href="@{/h-ui.admin/css/style.css}"/>
    <link rel="stylesheet" type="text/css" th:href="@{/lib/bootstrap/css/bootstrap.css}"/>
    <link rel="stylesheet" type="text/css" th:href="@{/lib/bootstrap-table/bootstrap-table.css}"/>
    <link rel="stylesheet" type="text/css" th:href="@{/lib/zTree/v3/css/zTreeStyle/zTreeStyle.css}"/>


    <script type="text/javascript" th:src="@{/lib/DD_belatedPNG_0.0.8a-min.js}"></script>
    <script>DD_belatedPNG.fix('*');</script>

    <title>添加医生</title>
</head>
<body>
<article class="page-container" >
        <form  class="form form-horizontal"  th:action="${prescriptionSurcharge eq null }  ?'prescriptionSurcharge/insert':'prescriptionSurcharge/update'" method="post" id="form-prescriptionSurcharge-add">
            <input type="hidden" id="surchargeId" value="" name="surchargeId" th:value=" ${prescriptionSurcharge != null} ? ${prescriptionSurcharge.surchargeId}">
            <div class="row cl">
                <label class="form-label col-xs-4 col-sm-3">药品名称：</label>
                <div class="formControls col-xs-8 col-sm-6">
                        <span class="select-box" style="width:150px;">
                            <select class="select"  name="dictionaryId" size="1">
                                <option value="">请选择药品名称</option>
                                <option th:each="dictionarie:${dictionaries}" th:selected="${prescriptionSurcharge != null} ? (${prescriptionSurcharge.dictionaryId} eq ${dictionarie.dictionaryId})" th:value="${dictionarie.dictionaryId}" th:text="${dictionarie.dictionaryName}"></option>
                            </select>
                        </span>
                </div>
            </div>

            <div class="row cl">
                <label class="form-label col-xs-4 col-sm-3">金额：</label>
                <div class="formControls col-xs-8 col-sm-6">
                    <input type="text" class="input-text" th:value=" ${prescriptionSurcharge != null} ? ${prescriptionSurcharge.surchargeMoney}"
                            id="surchargeMoney" name="surchargeMoney">
                </div>
            </div>

            <div class="row cl">
                <label class="form-label col-xs-4 col-sm-3">处方类型：</label>
                <div class="formControls col-xs-8 col-sm-6">
                        <span class="select-box" style="width:150px;">
                            <select class="select"  name="surchargeTypeId" size="1">
                                <option value="">请选择处方类型</option>
                                <option th:each="dictionarie:${typeNames}" th:selected="${prescriptionSurcharge != null} ? (${prescriptionSurcharge.surchargeTypeId} eq ${dictionarie.dictionaryId})" th:value="${dictionarie.dictionaryId}" th:text="${dictionarie.dictionaryName}"></option>
                            </select>
                        </span>
                </div>
            </div>


                <div class="row cl">
                    <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
                        <input class="btn btn-primary radius" type="submit" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
                    </div>
                </div>
        </form>


</article>

<!--_footer 作为公共模版分离出去-->
<script type="text/javascript" th:src="@{/lib/jquery/1.11.3/jquery.min.js}"></script>
<script type="text/javascript" th:src="@{/lib/jquery.validation/1.14.0/jquery.validate.js}"></script>
<script type="text/javascript" th:src="@{/lib/jquery.validation/1.14.0/messages_zh.js}"></script>
<script type="text/javascript" th:src="@{/lib/jquery.validation/1.14.0/validate-methods.js}"></script>
<script type="text/javascript" th:src="@{/lib/layer/2.4/layer.js}"></script>
<script type="text/javascript" th:src="@{/h-ui/js/H-ui.min.js}"></script>
<script type="text/javascript" th:src="@{/h-ui.admin/js/H-ui.admin.js}"></script> <!--/_footer 作为公共模版分离出去-->

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" th:src="@{/lib/My97DatePicker/4.8/WdatePicker.js}"></script>
<script type="text/javascript" th:src="@{/lib/datatables/1.10.0/jquery.dataTables.min.js}"></script>
<script type="text/javascript" th:src="@{/lib/bootstrap-table/bootstrap-table.js}"></script>
<script type="text/javascript" th:src="@{/lib/bootstrap-table/bootstrap-table-zh-CN.min.js}"></script>

<!--业务-->
<script type="text/javascript">
    $(function () {
        $('.skin-minimal input').iCheck({
            checkboxClass: 'icheckbox-blue',
            radioClass: 'iradio-blue',
            increaseArea: '20%'
        });

        $("#form-prescriptionSurcharge-add").validate({
            rules: {
                dictionaryId:{
                    required:true
                },
                surchargeMoney:{
                    required:true,
                    min:1
                },
                surchargeTypeId:{
                  required:true,
                }

            },
            success: "valid",
            messages: {
                dictionaryId:{
                    required:"药品名称不能为空"
                },
                surchargeMoney:{
                    required:"金额至少为1"
                },
                surchargeTypeId:{
                    required:"处方类型不能为空",
                }
            },
            submitHandler: function (form) {
                $(form).ajaxSubmit(function (data) {
                    layer.msg(data.msg, {icon: data.code, time: 1000}, function () {
                        //操作成功刷新数据
                        if (data.code == 1) {

                            //刷新父页面表格
                            parent.refresh();
                            //关闭窗口
                            parent.layer.closeAll();
                        }
                    });
                });
               }
        });

        /*医生擅长，医生描述动态显示*/
        // var prescriptionSurcharge=$("#prescriptionSurchargeId").val();
        // console.log(prescriptionSurcharge)
        // if (prescriptionSurcharge == ""){
        //     $("#prescriptionSurcharge-expert").css("display","none");
        //     $("#prescriptionSurcharge-desc").css("display","none");
        //
        // }else {
        //     $("#prescriptionSurcharge-expert").css("display","block");
        //     $("#prescriptionSurcharge-desc").css("display","block");
        //
        // }

    });

</script>
<!--/请在上方写此页面业务相关的脚本-->
</body>
</html>